<UserControl x:Class="Microsoft.PowerShell.CmdletManagement.ExtendedPasswordBox"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:Microsoft.PowerShell.CmdletManagement" x:Name="root" >

    <Grid Margin="5,5,15,5">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>


        <DockPanel HorizontalAlignment="Stretch"  VerticalAlignment="Top" >
            <TextBlock Text="{Binding Label, ElementName=root}" Margin="0,3,10,0" MinWidth="75" MaxWidth="170"  />
            <PasswordBox  Name="UserInput" Margin="0,0,10,0"  DockPanel.Dock="Top" my:PasswordBoxAssistant.BindPassword="true" my:PasswordBoxAssistant.BoundPassword="{Binding Path=Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
            
        </DockPanel>

        <TextBlock TextWrapping="Wrap" Margin="15,3,0,0" Grid.Row="1" Text="{Binding HelpText, ElementName=root}"
               Foreground="{DynamicResource HelpTextFontColor}"
               Visibility="{Binding ElementName=UserInput, Path=IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}}"
               ></TextBlock>
    </Grid>



    <!--
  
  <Grid Margin="5,5,15,5">
    <Grid.RowDefinitions>
      <RowDefinition />
      <RowDefinition />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="100" />
      <ColumnDefinition  />
    </Grid.ColumnDefinitions>

    <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Label, ElementName=root}" Margin="0,3,0,0" />
    <TextBox   Name="UserInput" Grid.Row="0" Grid.Column="1" Margin="0,0,10,0" TextChanged="ValueChanged">
      <TextBox.Text>
        <Binding Path="Value" ElementName="root" UpdateSourceTrigger="PropertyChanged">
        </Binding>
      </TextBox.Text>
    </TextBox>
    <TextBlock TextWrapping="Wrap" Margin="15,3,0,0" Grid.Row="1" Grid.ColumnSpan="2" Text="{Binding HelpText, ElementName=root}"
         Foreground="{DynamicResource HelpTextFontColor}"
               Visibility="{Binding ElementName=UserInput, Path=IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}}"
                   ></TextBlock>
  </Grid>

  -->



</UserControl>
